package com.yzd.learnjava.io;

import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.util.Arrays;

import com.yzd.learnjava.util.Print;

public class Iodemo {

	public static void main(String[] args) throws IOException {
		File file = new File(".");
		String[] names = file.list();
		Print.print(Arrays.toString(names));
		Print.print("name : " + file.getName());
		Print.print("Parent: " + file.getParent());
		Print.print("path: " + file.getPath());
		Print.print("AbsolutePath: " + file.getAbsolutePath());
		Print.print("isAbsolute : " + file.isAbsolute());
		Print.print("AbsolutePath : " + file.getAbsoluteFile().getPath());
		Print.print("AbsoluteName : " + file.getAbsoluteFile().getName());
		Print.print("AbsoluteName : " + file.getAbsoluteFile().getParent());
		Print.print("CanonicalPath : " + file.getCanonicalPath());
		Print.print("TotalSpace : " + file.getTotalSpace());
		Print.print("FreeSpace : " + file.getFreeSpace());
		Print.print("UsableSpace : " + file.getUsableSpace());
		//Print.print(file.getParentFile().getName());
		
		File[] rs = File.listRoots();
		for(File f : rs) {
			Print.printnb("rs : " + f.getName() + " , ");
		}
		
		RandomAccessFile raf = new RandomAccessFile("", "r");
		
		ByteBuffer byteBuffer = ByteBuffer.allocate(1000);
		
		
	
	}

}
